package io.renren.modules.lanling.service.impl;

import cn.hutool.core.lang.Validator;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.lanling.dao.SchoolEvaluateDao;
import io.renren.modules.lanling.entity.SchoolEvaluateEntity;
import io.renren.modules.lanling.service.SchoolEvaluateService;


@Service("schoolEvaluateService")
public class SchoolEvaluateServiceImpl extends ServiceImpl<SchoolEvaluateDao, SchoolEvaluateEntity> implements SchoolEvaluateService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        Object name = params.get("name");
        if (Validator.isEmpty(name)) {
            params.remove("name");
        }

        Query query = new Query(params);
        List<SchoolEvaluateEntity> examEntityList = this.baseMapper.queryList(query);
        Integer total = this.baseMapper.queryTotal(query);
        return new PageUtils(examEntityList, total, query.getLimit(), query.getCurrPage());
    }

    @Override
    public SchoolEvaluateEntity queryObject(Integer id) {
        return this.baseMapper.queryObject(id);
    }

    @Override
    public Boolean update(SchoolEvaluateEntity schoolEvaluateEntity) {
        return this.baseMapper.update(schoolEvaluateEntity);
    }

}
